bitkeeper revision 1.1159.223.85 (420a9b72OGag4m4sDtlxM-918tbudQ)
authoriap10@freefall.cl.cam.ac.uk <iap10@freefall.cl.cam.ac.uk>
Wed, 9 Feb 2005 23:23:30 +0000 (23:23 +0000)
committeriap10@freefall.cl.cam.ac.uk <iap10@freefall.cl.cam.ac.uk>
Wed, 9 Feb 2005 23:23:30 +0000 (23:23 +0000)
Subject: [Xen-devel] VNET - full update

Allows vnets to compile and run under 2.6.10/xen-testing.
PATCH: vnet-cleanup.patch
Signed off by: bgb@nt-nv.com
Signed-off-by: ian@xensource.com
.rootkeys
tools/vnet/INSTALL [new file with mode: 0644]
tools/vnet/Makefile
tools/vnet/vnet-module/Makefile-2.6
tools/vnet/vnet-module/if_varp.h
tools/vnet/vnet-module/varp.c
tools/vnet/vnetd/vcache.c

index a6f49dc24c7d52724c7b26a0ebce70bb98902883..fd74dc7d31a35c8649423c612fb85e1c013f649f 100644 (file)
--- a/.rootkeys
+++ b/.rootkeys
 41013a83z27rKvWIxAfUBMVZ1eDCDg tools/sv/inc/script.js
 40fcefb3zGC9XNBkSwTEobCoq8YClA tools/sv/inc/style.css
 41a21888_WlknVWjSxb32Fo13_ujsw tools/vnet/00README
+420a9b706I-bN_uPdiy0m3rmDifNNg tools/vnet/INSTALL
 41a21888bOiOJc7blzRbe4MNJoaYTw tools/vnet/Makefile
 41a21888mg2k5HeiVjlQYEtJBZT4Qg tools/vnet/doc/vnet-module.txt
 41a21888cuxfT8wjCdRR6V1lqf5NtA tools/vnet/doc/vnet-xend.txt
diff --git a/tools/vnet/INSTALL b/tools/vnet/INSTALL
new file mode 100644 (file)
index 0000000..8ece553
--- /dev/null
@@ -0,0 +1,31 @@
+To compile and install run "make install"; if it fails or you need to reinstall 
+run "make clean" first or the build will fail, at least that is what I have 
+found under 2.6.10.
+
+Other important items:
+1)     You will need to have your xen0 kernel compiled with HMAC_SUPPORT 
+       2.6.x = (MAIN MENU: Cryptographic Options -> HMAC Support)
+       BEFORE running "make install".
+
+2)     You will want at least some of the other alogorithms listed under
+       "Cryptographic Options" for the kernel compiled as modules.
+
+3)     You will want the networking IPsec/VLAN options compiled in as modules
+       2.6.x = (MAIN MENU: Device Drivers -> Networking Support -> 
+                               Networking Options ->
+                                       IP: AH transformation
+                                       IP: ESP transformation
+                                       IP: IPComp transformation 
+                                       IP: tunnel transformation
+
+                                       IPsec user configuration interface
+       
+                                       802.1Q VLAN Support
+
+4)     The module (vnet_module) will not properly load from the command line
+       with a "modprobe vnet_module".  Use network-vnet to properly configure
+       your system and load the module for you.
+
+Please refer to the additional documentation found in tools/vnet/doc for
+proper syntax and config file parameters.
+
index 63939dff9dbf41de6395da2fa59bbb466ac3767e..d4d8183130755d1ea7a2f515ebe7223faa3e6514 100644 (file)
@@ -12,6 +12,7 @@ export prefix?=$(shell cd ../../dist/install && pwd)
 all: compile
 
 compile: vnetd vnet-module
+#compile: vnet-module
 
 gc.tar.gz:
        wget http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/$@
@@ -20,10 +21,8 @@ gc: gc.tar.gz
        tar xfz gc.tar.gz
        ln -sf gc?.? gc
 
-gc/Makefile:
-       (cd gc && ./configure --prefix=`pwd`/install)
-
-gc-install: gc gc/Makefile
+gc-install: gc 
+       (cd gc && make test && ./configure --prefix=`pwd`/install)
        make -C gc
        make -C gc install
 
@@ -47,5 +46,6 @@ install: compile
 clean:
        -$(MAKE) -C vnetd clean
        -$(MAKE) -C vnet-module clean
-
+       -rm -rf gc?.? gc
+       
 pristine: clean gc-pristine
index 64e57ea5ffb60da69f51cf2783e73d441363eece..053391e572f0daab1d8e01db966e11106a33eb28 100644 (file)
@@ -38,8 +38,8 @@ module modules:
 
 .PHONY: install install-module modules_install
 install install-module modules_install: module
-       install -m 0755 -d $(DESTDIR)$(KERNEL_MODULE_DIR)
-       install -m 0554 $(KERNEL_MODULE) $(DESTDIR)$(KERNEL_MODULE_DIR)
+       install -m 0755 -d $(DESTDIR)$(KERNEL_MODULE_DIR)/xen
+       install -m 0554 $(KERNEL_MODULE) $(DESTDIR)$(KERNEL_MODULE_DIR)/xen
 
 .PHONY: clean
 clean:
index 49058471dbfac2e2adfa68bb3f7edd5236299c08..c4b752ac49db63eeb90a86043bf8a594789d3dde 100644 (file)
@@ -36,7 +36,7 @@ typedef struct VnetMsgHdr {
 } __attribute__((packed)) VnetMsgHdr;
 
 typedef struct VarpHdr {
-    VnetMsgHdr;
+    VnetMsgHdr vnetmsghdr;
     uint32_t vnet;
     Vmac vmac;
     uint32_t addr;
@@ -50,4 +50,4 @@ typedef struct VarpHdr {
 
 
 
-#endif /* ! _VNET_IF_VARP_H */
+#endif  /* ! _VNET_IF_VARP_H */
index 3b1507e045c25b69b3f3af26f665ba8fe0ac2492..f7bdf81d9703d708d115564f7ac19f39cb684e49 100644 (file)
@@ -368,8 +368,8 @@ int varp_send(u16 opcode, struct net_device *dev, struct sk_buff *skbin,
     // Varp header.
     varph = (void*)skb_put(skbout, varp_n);
     *varph = (VarpHdr){};
-    varph->id                = htons(VARP_ID);
-    varph->opcode            = htons(opcode);
+    varph->vnetmsghdr.id     = htons(VARP_ID);
+    varph->vnetmsghdr.opcode = htons(opcode);
     varph->vnet              = htonl(vnet);
     varph->vmac              = *vmac;
     varph->addr              = saddr;
@@ -1076,9 +1076,9 @@ int varp_handle_message(struct sk_buff *skb){
         goto exit;
     }
     mine = 1;
-    if(varph->id != htons(VARP_ID)){
+    if(varph->vnetmsghdr.id != htons(VARP_ID)){
         // It's not varp at all - ignore it.
-        wprintf("> Unknown id: %d \n", ntohs(varph->id));
+        wprintf("> Unknown id: %d \n", ntohs(varph->vnetmsghdr.id));
         goto exit;
     }
     if(1){
@@ -1086,13 +1086,13 @@ int varp_handle_message(struct sk_buff *skb){
                 NIPQUAD(skb->nh.iph->saddr), NIPQUAD(skb->nh.iph->daddr));
         dprintf("> sport=%u dport=%u\n", ntohs(skb->h.uh->source), ntohs(skb->h.uh->dest));
         dprintf("> opcode=%d vnet=%u vmac=" MACFMT " addr=" IPFMT "\n",
-                ntohs(varph->opcode),
+                ntohs(varph->vnetmsghdr.opcode),
                 ntohl(varph->vnet),
                 MAC6TUPLE(varph->vmac.mac),
                 NIPQUAD(varph->addr));
         varp_dprint();
     }
-    switch(ntohs(varph->opcode)){
+    switch(ntohs(varph->vnetmsghdr.opcode)){
     case VARP_OP_REQUEST:
         err = varp_handle_request(skb, varph);
         break;
@@ -1100,7 +1100,7 @@ int varp_handle_message(struct sk_buff *skb){
         err = varp_handle_announce(skb, varph);
         break;
     default:
-        wprintf("> Unknown opcode: %d \n", ntohs(varph->opcode));
+        wprintf("> Unknown opcode: %d \n", ntohs(varph->vnetmsghdr.opcode));
        break;
     }
   exit:
index cd069882368e8f50db9abc3f572efab57215ff88..1ea81ba29254600724b0aac8ddbf303f5d2e135d 100644 (file)
@@ -102,11 +102,11 @@ int varp_send(Conn *conn, uint16_t opcode, uint32_t vnet, Vmac *vmac, uint32_t a
     int varp_n = sizeof(VarpHdr);
     VarpHdr varph = {};
 
-    varph.id     = htons(VARP_ID);
-    varph.opcode = htons(opcode);
-    varph.vnet   = vnet;
-    varph.vmac   = *vmac;
-    varph.addr   = addr;
+    varph.vnetmsghdr.id     = htons(VARP_ID);
+    varph.vnetmsghdr.opcode = htons(opcode);
+    varph.vnet              = vnet;
+    varph.vmac              = *vmac;
+    varph.addr              = addr;
 
     if(0){
         struct sockaddr_in self;
@@ -503,7 +503,7 @@ void VarpCache_sweep(VarpCache *z, int all){
  * @param local whether it's local or not
  */
 void vcache_forward_varp(VarpHdr *varph, int local){
-    uint16_t opcode = ntohs(varph->opcode);
+    uint16_t opcode = ntohs(varph->vnetmsghdr.opcode);
     if(local){
         ConnList *l;
         for(l = vnetd->connections; l; l = l->next){
@@ -611,7 +611,7 @@ int vcache_handle_message(IPMessage *msg, int local){
         dprintf("> opcode=%d vnet=%u vmac=" MACFMT "\n",
                 ntohs(varph->opcode), ntohl(varph->vnet), MAC6TUPLE(varph->vmac.mac));
     }
-    switch(ntohs(varph->opcode)){
+    switch(ntohs(varph->vnetmsghdr.opcode)){
     case VARP_OP_REQUEST:
         err = vcache_handle_request(msg, varph, local);
         break;